import React from "react"

function addState(Com) {
    return class NewCom extends React.Component {
        state = {
            count: 888
        }
        add = () => {
            this.setState({
                count: this.state.count += 1
            })
        }
        render() {
            const { count } = this.state
            return <div>
                <Com count = { count } add = { this.add }/>
            </div>
        }
    }
}


export {
    addState
}


// 柯里化函数

// function fn() {
//   return () => {
//     return () => {

//     }
//   }
// }

// fn()()()